#ifndef MINUNIT_H
#define MINUNIT_H

#include <stdio.h>

// Assertion macro
#define mu_assert(message, test) do { \
    if (!(test)) return message; \
} while (0)

//Run test macro
#define mu_run_test(test) do { \
    char *message = test(); \
    tests_run++; \
    if (message) return message; \
} while (0)

// Main test function macro
#define RUN_TESTS(name) int main() { \
    char *result = name(); \
    if (result) { \
        printf("Test failed: %s\n", result); \
    } else { \
        printf("All tests passed!\n"); \
    } \
    printf("Total tests run: %d\n", tests_run); \
    return result != NULL; \
}

// Declare test counter
extern int tests_run;

#endif